/*
 * Copyright (C) Michael Martin & Antonio Carrozzini (TBJD)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

package org.tbjd.client.decorators;

import java.util.ArrayList;
import java.util.List;

import org.tbjd.client.beans.Resource;
import org.tbjd.client.guis.AbstractItem;
import org.tbjd.client.guis.resourcePicker.items.ResourcePickerItem;
import org.tbjd.client.interfaces.ResourceDecorator;

/**
 * <p>
 * The ResourcePickerDecorator is used to decorate {@link org.tbjd.client.guis.resourcePicker.items.ResourcePickerItem ResourcePickerItem}
 * </p>
 * 
 * @author Michael Martin
 * @author Antonio Carrozzini
 * @version 1.0
 */
public class ResourcePickerDecorator implements ResourceDecorator {

	private static ResourcePickerDecorator instance = null;
	
	private ResourcePickerDecorator(){
	}

	public static ResourcePickerDecorator getInstance(){
		if(instance == null){
			instance = new ResourcePickerDecorator();
		}
		
		return instance;
	}

	public List<?> decorateAsList(List<Resource> resources) {

		// receiving the whole list of tasks and the whole list of resources
		List<ResourcePickerItem> decoratedList = new ArrayList<ResourcePickerItem>();

		for (Resource eachResource : resources) {
			decoratedList.add(new ResourcePickerItem(eachResource));
		}

		return decoratedList;
	}

	public AbstractItem decorate(Resource resource) {
		return null;
	}

}